import Vue from 'vue'
import VueRouter from 'vue-router'
//主页面
import Index from '../views/Index.vue'
import MyMusic from '../views/MyMusic.vue'
import Friend from '../views/Friend.vue'
import Video from '../views/Video.vue'

//主页面下的页面
import Push from '../views/Index/Push.vue'
import Ranking from '../views/Index/Ranking.vue'
import Playlist from '../views/Index/Playlist.vue'
import Singer from '../views/Index/Singer.vue'
// 搜索
import Search from '../views/Search.vue'
import single from '../views/Search/single.vue'
import album from '../views/Search/album.vue'
//详情页
import PlaylistDetail from '../views/Detail/PlaylistDetail.vue'
//用户个人信息
import UserDetail from '../views/Detail/UserDetail.vue'


Vue.use(VueRouter)

const routes = [{
        path: '/',
        component: Index,
        props: true,
        children: [{
                path: '/',
                component: Push,
            },
            {
                path: '/Ranking',
                component: Ranking
            },
            {
                path: '/Playlist',
                component: Playlist
            },
            {
                path: '/Singer',
                component: Singer
            },
            {
                path: '/Detail/PlaylistDetail',
                component: PlaylistDetail
            },
            {
                path: '/Detail/UserDetail',
                component: UserDetail
            }
        ]
    },
    //发现推荐页面
    {
        path: '/Push',
        name: 'Push',
        component: Push,
    },
    //我的音乐页面
    {
        path: '/MyMusic',
        name: 'MyMusic',
        component: MyMusic,
    },
    //朋友页面
    {
        path: '/Friend',
        name: 'Friend',
        component: Friend,
    },
    //MV页面
    {
        path: '/Video',
        name: 'Video',
        component: Video,
    },
    //搜索页面
    {
        path: '/Search',
        name: 'Search',
        component: Search,
        children: [{
                path: '/single',
                name: 'single',
                component: single,
            },
            {
                path: '/album',
                name: 'album',
                component: album
            },
        ]
    }
]

const router = new VueRouter({
    mode: 'history',
    base: process.env.BASE_URL,
    routes
})

export default router